//
//  ALUserInfo.m
//  THB
//
//  Created by 哀木涕 on 16/9/27.
//  Copyright © 2016年 阿拉丁电商. All rights reserved.
//

#import "ALUserInfo.h"

@interface ALUserInfo()


@end


@implementation ALUserInfo

#pragma mark 初始化

- (NSString*)localFilePathName
{
    NSString *docDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
    return [docDir stringByAppendingPathComponent:@"userInfo.plist"];
}
//保存用户信息
- (BOOL)saveUserInfo{
    return [self.mj_keyValues writeToFile:[self localFilePathName] atomically:YES];
}



#pragma mark 用户数据读取
- (void)setAccessToken:(NSString *)accessToken{
    _accessToken = accessToken;
    [self saveUserInfo];
}
- (void)setId:(NSInteger)id{
    _id = id;
    [self saveUserInfo];
}
- (void)setZfb_name:(NSString *)zfb_name{
    _zfb_name = zfb_name;
    [self saveUserInfo];
}
- (void)setRealname:(NSString *)realname{
    _realname = realname;
    [self saveUserInfo];
}
- (void)setPhone:(NSString *)phone{
    _phone = phone;
    [self saveUserInfo];
}
- (void)setZfb_account:(NSString *)zfb_account{
    _zfb_account = zfb_account;
    [self saveUserInfo];
}
- (void)setZfb_au:(NSString *)zfb_au{
    _zfb_au = zfb_au;
    [self saveUserInfo];
}
- (void)setNickname:(NSString *)nickname{
    _nickname = nickname;
    [self saveUserInfo];
}
- (void)setZm_open_id:(NSString *)zm_open_id{
    _zm_open_id = zm_open_id;
    [self saveUserInfo];
}
- (void)setZm_score:(NSInteger)zm_score{
    _zm_score = zm_score;
    [self saveUserInfo];
}
- (void)setCrtified:(BOOL)crtified{
    _crtified = crtified;
    [self saveUserInfo];
}
- (void)setIs_zmauth:(BOOL)is_zmauth{
    _is_zmauth = is_zmauth;
    [self saveUserInfo];
}
- (void)setIs_Isv:(BOOL)is_Isv{
    _is_Isv = is_Isv;
    [self saveUserInfo];
}
- (void)setIs_faceRecognition:(BOOL)is_faceRecognition{
    _is_faceRecognition = is_faceRecognition;
    [self saveUserInfo];
}
- (void)setIs_mobileBook:(BOOL)is_mobileBook{
    _is_mobileBook = is_mobileBook;
    [self saveUserInfo];
}
- (void)setTotal_money:(float)total_money{
    _total_money = total_money;
    [self saveUserInfo];
}
- (void)setCreditVal:(NSInteger)creditVal{
    _creditVal = creditVal;
    [self saveUserInfo];
}

- (void)setTotalCommission:(float)totalCommission{
    _totalCommission = totalCommission;
    [self saveUserInfo];
}
@end
